package academic.ui.client.widgets.tools;

public class ToolTip {

	
	public ToolTip() {}
	
	public native static void initToolTip() /*-{
		$wnd.$(document).ready(function(){
			$wnd.$('#homeWithTip').tooltip({ effect: 'slide',relative:'true',
				tipClass:'usertooltip',
				delay:200,
				offset:[200, 80]});
			 });
	}-*/;

	public static native void initLongTooltip() /*-{
		$wnd.$(document).ready(function(){
			var timer;
			var direction='.next';
			$wnd.$('.longTip').each(function(){$wnd.$(this).tooltip({ effect: 'slide',
				relative:'true',
				tipClass:'dealsTooltip',
				delay:200,
				offset:[200, 180]}).mouseenter(function() {
					timer = $wnd.setInterval(function() {
					$wnd.console.log(direction);
					$wnd.console.log('index:'+$wnd.$('.tooltipWizard').scrollable().getIndex());
					$wnd.console.log('size:'+$wnd.$('.tooltipWizard').scrollable().getSize());
					if(direction=='.next' && $wnd.$('.tooltipWizard').scrollable().getIndex() >= ($wnd.$('.tooltipWizard').scrollable().getSize()-1))
					{
						direction='.prev';
						$wnd.$('.recentDealsSlide '+direction).click();
					}
					else if(direction=='.prev' && $wnd.$('.tooltipWizard').scrollable().getIndex()<=0)
					{
						direction='.next';
						$wnd.$('.recentDealsSlide '+direction).click();
					}
					else
						$wnd.$('.recentDealsSlide '+direction).click();
					
				
				}	,1500);
				}).mouseleave(function() {
					$wnd.clearTimeout(timer);
					
				});
			
			});
		});			
	}-*/;
}
